const app = getApp()
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    //myTitle就是自定义的属性名，需要指定type（String,Number,Array,Objact）
   active:{
     type:Number,
     value:1
   }
 },
  data: {
    
  },
  
  /**
   * 组件的初始数据
   */
  

  /**
   * 组件的方法列表
   */
  methods: {
    pageTo(e) {
		let tmpIds = [
			"QzCQONJbR2Nf_7fx3L2UBk0S4odxPd25Reqnz_tBf_U",
			"IY5PJ6OLjDvEsblvJjxrKpGtfAd9Wmw37OZTtSJU32k",
			"Ju4fN6l5yydQ-Fu-EMmFCz--tJWa6yTVxhRxdeUni6A"
			];
			wx.requestSubscribeMessage({
			  tmplIds: tmpIds,
			  success (res) {
			   let acceptTmpList = [];
			   for(let i = 0; i < tmpIds.length; i++ )
			   {
				  let tmpId = tmpIds[i];
				  if(res[tmpId] == "accept")
				  {
					acceptTmpList.push(tmpId);
				  }
				}
				wx.login({
				  success: (result) => {
						console.log(result.code)
					app.indexApi.dinyue({
						code:result.code
						
					}).then(a => {})
				  },
				  fail: (res) => {console.log(res)},
				  complete: (res) => {},
				})
			   }
			  });
	
      let url = e.currentTarget.dataset.url;
      wx.redirectTo({
        url: url
      })
	},
	
  }
})